<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link type="text/css" rel="stylesheet" href="/TP/Public/css/style.css" />
    <!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
    <script type="text/javascript" src="/TP/Public/address/js/jquery-1.11.0.min.js"></script>
<title>数码商城个人中心</title>

  <style>
      .eidt{
        border:1px solid red;
        width: 400px;
        height: 200px;
        position:fixed;
        background:white;
        left:50%;
        top:40%;
        display:none
      }
      .addclass{
        border:1px solid red;
      }
  </style>
</head>
<body>  
<!--Begin Header Begin-->
<div class="soubg">
    <div class="sou">
        <span><a href="<?php echo U('home/index/index');?>">回到首页</a></span>
        <span class="fr">
            <span class="ss">
                <div class="ss_list">
                    <a href="#">收藏夹</a>
                    <div class="ss_list_bg">
                        <div class="s_city_t"></div>
                        <div class="ss_list_c">
                            <ul>
                                <li><a href="#">我的收藏夹</a></li>
                            </ul>
                        </div>
                    </div>     
                </div>
                <div class="ss_list">
                    <a href="#">客户服务</a>
                    <div class="ss_list_bg">
                        <div class="s_city_t"></div>
                        <div class="ss_list_c">
                            <ul>
                                <li><a href="#">客户服务</a></li>
                                <li><a href="#">客户服务</a></li>
                                <li><a href="#">客户服务</a></li>
                            </ul>
                        </div>
                    </div>    
                </div>
                <div class="ss_list">
                    <a href="#">网站导航</a>
                    <div class="ss_list_bg">
                        <div class="s_city_t"></div>
                        <div class="ss_list_c">
                            <ul>
                                <li><a href="#">网站导航</a></li>
                            </ul>
                        </div>
                    </div>    
                </div>
            </span>
            <span class="fl">|&nbsp;关注我们：</span>
            <span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#" class="sh2">微信</a></span>
            <span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img src="/TP/Public/images/s_tel.png" align="absmiddle" /></a></span>
        </span>
    </div>
</div>
<div class="m_top_bg" style="height: 60px;">
   
</div>
<!--End Header End--> 
<div class="i_bg bg_color">
    <!--Begin 用户中心 Begin -->
  <div class="m_content">
      <div class="m_left">
	<div class="left_n">管理中心</div>
    <div class="left_m">
        <div class="left_m_t t_bg2">会员中心</div>
        <ul>
            <li><a href="<?php echo U('home/member/index');?>">用户信息</a></li>
            <li><a href="<?php echo U('home/member/Member_Collect');?>">我的收藏</a></li>
            <!-- <li><a href="Member_Msg.html">我的留言</a></li> -->
            <li><a href="<?php echo U('home/member/Member_comment');?>">我的评论</a></li>
        </ul>
    </div>
    <div class="left_m">
    	<div class="left_m_t t_bg1">订单中心</div>
        <ul>
        	<li><a href="<?php echo U('home/member/member_order');?>">我的订单</a></li>
            <li><a href="<?php echo U('home/member/Member_Address');?>">收货地址</a></li>
        </ul>
    </div>
    <div class="left_m">
    	<div class="left_m_t t_bg3">账户中心</div>
        <ul>
        	<li><a href="<?php echo U('home/Member/safe_index');?>">账户安全</a></li>
        </ul>
    </div>
</div>
    <div class="m_right">
            <div class="mem_tit">收货地址(最多只能添加6个地址)</div>
        <?php if(is_array($list)): foreach($list as $key=>$val): ?><div class="address <?php echo ($val['status']==1?"addclass":""); ?>" style="width: 420px;height:190px;float: left;margin-left: 20px;" id="add<?php echo ($val['id']); ?>">
              <div class="a_close"><a href="javascript:void(0)"><img src="/TP/Public/images/a_close.png" onclick="do_Del(<?php echo ($val['id']); ?>)" /></a></div>
              <table border="0" class="add_t" align="center" style="width:98%; margin:10px auto;" cellspacing="0" cellpadding="0" id="table<?php echo ($val['id']); ?>">
                  <tr>
                    <td align="right" width="80">收货人姓名：</td>
                    <td><?php echo ($val['linkman']); ?></td>
                  </tr>
                  <tr>
                    <td align="right">详细地址：</td>
                    <td><?php echo ($val['address']); ?></td>
                  </tr>
                  <tr>
                    <td align="right">手机：</td>
                    <td><?php echo ($val['phone']); ?></td>
                  </tr>
                  <tr>
                    <td align="right">邮编：</td>
                    <td><?php echo ($val['code']); ?></td>
                  </tr>
                  <input type="hidden" value="<?php echo ($val['id']); ?>">
                  <input type="hidden" value="<?php echo ($val['uid']); ?>">
                </table>
                <p align="right" id="p<?php echo ($val['id']); ?>">
                  <a href="javascript:void(0)" onclick="status(<?php echo ($val['id']); ?>)" style="color:#ff4e00;">设为默认</a>　
                  <a href="javascript:void(0)" onclick="edit(<?php echo ($val['id']); ?>)" style="color:#ff4e00;">编辑</a>
                </p>
            </div><?php endforeach; endif; ?>
        <div class="eidt" >
          <form action="<?php echo U('Home/member/member_eidt');?>" method="post">
            <table style="margin-top: 30px">
                <tr>
                  <td>收货人姓名：</td>
                  <td><input type="text" name="linkman" value="<?php echo ($val['linkman']); ?>"></td>
                </tr>
                <tr>
                  <td>详细地址：</td>
                  <td><input type="text" name="address"></td>
                </tr>
                <tr>
                  <td>手机：</td>
                  <td><input type="text" name="phone"></td>
                </tr>
                <tr>
                  <td>邮编：</td>
                  <td><input type="text" name="code"></td>
                </tr>
            </table>
            <input type="submit" value="保存" style="margin-left: 150px">
            <input class="cancel" type="button" value="取消">
            <input type="hidden" name="id" class="aid">
            <input type="hidden" name="uid" class="uid">
          </form>
        </div>
        
          <div style="clear:both;"></div>

          <?php if((6-$sum) > 0): ?><p align="right">
                <a href="javascript:void(0)" class="add_b" onclick="edit()">添加地址</a>
            </p><?php endif; ?>
            
        </div>
    </div>
  <!--End 用户中心 End--> 
    <!--Begin Footer Begin -->
    <div class="b_btm_bg b_btm_c">
        <div class="b_btm">
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="/TP/Public/images/b1.png" width="62" height="62" /></td>
                <td><h2>正品保障</h2>正品行货  放心购买</td>
              </tr>
            </table>
			<table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="/TP/Public/images/b2.png" width="62" height="62" /></td>
                <td><h2>满38包邮</h2>满38包邮 免运费</td>
              </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="/TP/Public/images/b3.png" width="62" height="62" /></td>
                <td><h2>天天低价</h2>天天低价 畅选无忧</td>
              </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="/TP/Public/images/b4.png" width="62" height="62" /></td>
                <td><h2>准时送达</h2>收货时间由你做主</td>
              </tr>
            </table>
        </div>
    </div>

    <div class="b_nav">
      <dl>                                                                                            
          <dt><a href="#">新手上路</a></dt>
            <dd><a href="#">售后流程</a></dd>
            <dd><a href="#">购物流程</a></dd>
            <dd><a href="#">订购方式</a></dd>
            <dd><a href="#">隐私声明</a></dd>
            <dd><a href="#">推荐分享说明</a></dd>
        </dl>
        <dl>
          <dt><a href="#">配送与支付</a></dt>
            <dd><a href="#">货到付款区域</a></dd>
            <dd><a href="#">配送支付查询</a></dd>
            <dd><a href="#">支付方式说明</a></dd>
        </dl>
        <dl>
          <dt><a href="#">会员中心</a></dt>
            <dd><a href="#">资金管理</a></dd>
            <dd><a href="#">我的收藏</a></dd>
            <dd><a href="#">我的订单</a></dd>
        </dl>
        <dl>
          <dt><a href="#">服务保证</a></dt>
            <dd><a href="#">退换货原则</a></dd>
            <dd><a href="#">售后服务保证</a></dd>
            <dd><a href="#">产品质量保证</a></dd>
        </dl>
        <dl>
          <dt><a href="#">联系我们</a></dt>
            <dd><a href="#">网站故障报告</a></dd>
            <dd><a href="#">购物咨询</a></dd>
            <dd><a href="#">投诉与建议</a></dd>
        </dl>
        <div class="b_tel_bg">
          <a href="#" class="b_sh1">新浪微博</a>            
          <a href="#" class="b_sh2">腾讯微博</a>
            <p>
            服务热线：<br />
            <span>400-123-4567</span>
            </p>
        </div>
        <div class="b_er">
            <div class="b_er_c"><img src="/TP/Public/images/er.gif" width="118" height="118" /></div>
            <img src="/TP/Public/images/ss.png" />
        </div>
    </div> 
    <div class="btmbg">
    <div class="btm">
          备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com   Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
            <img src="/TP/Public/images/b_1.gif" width="98" height="33" /><img src="/TP/Public/images/b_2.gif" width="98" height="33" /><img src="/TP/Public/images/b_3.gif" width="98" height="33" /><img src="/TP/Public/images/b_4.gif" width="98" height="33" /><img src="/TP/Public/images/b_5.gif" width="98" height="33" /><img src="/TP/Public/images/b_6.gif" width="98" height="33" />
        </div>      
    </div>
    <!--End Footer End -->    
</div>
  
</body>

<script>
          function status(id){
              $("div").removeClass("addclass");
              
              var sid = '#add'+id;
              $(sid).addClass("addclass");
              $.get(
                  "<?php echo U('home/member/member_status');?>",
                  {'id':id,'status':1}
                )};
            

            function do_Del(did){
              var id = "#add"+did;
              if(confirm("确定要删除？")){
                $(id).remove();
                $.get(
                    "<?php echo U('home/member/member_del');?>",
                    {'id':did},
                    function($data){
                      window.location.reload();
                    }
                  );
              }
            }

        function edit(id){
           $('<div class="blank"></div>').css({
                'width':$(window).width(),
                'height':$(window).height(),
                'background':'rgba(0,0,0,0.3)',
                'position':'fixed',
                'left':0,
                'top':0,
              }).appendTo($(document.body));
              init(id);
        }

          function init(id){
            $('.eidt').css({
              'margin-left':function(){
                return -(Math.ceil($(this).width() / 2));
              },
              'margin-top':function(){
                return -(Math.ceil($(this).height() / 2));
              },
              'display':'block',
            }).appendTo($(document.body));
            var id = "#table"+id;
            
            var v1 = $(id+" td").eq(1).text();
            var v2 = $(id+" td").eq(3).text();
            var v3 = $(id+" td").eq(5).text();
            var v4 = $(id+" td").eq(7).text();
            // alert(v4);
            var v5 = $(id+" input:hidden").eq(0).val();
            var v6 = $(id+" input:hidden").eq(1).val()
            
            $('.eidt table td input:eq(0)').val(v1);
            $('.eidt table td input:eq(1)').val(v2);
            $('.eidt table td input:eq(2)').val(v3);
            $('.eidt table td input:eq(3)').val(v4);
            $('.aid').val(v5);
            $('.uid').val(v6);
          }

          $('.cancel').click(function(){
              $('.eidt').css('display','none');
              $('.blank').remove();
          });
          </script>
<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>